local bojianxiong = fk.CreateSkill {
  name = "bojianxiong",
  tags = { Skill.Compulsory },
}

Fk:loadTranslationTable{
  ["bojianxiong"] = "奸雄",
  [":bojianxiong"] = "锁定技，当其他角色于其回合外得到牌后/回复体力后，你摸等量的牌/回复等量的体力。",  -- 修改描述，移除次数限制

  ["$bojianxiong1"] = "气冲霄汉，胸怀千军。",
  ["$bojianxiong2"] = "纵横驰骋逐鹿称雄。",
}

bojianxiong:addEffect(fk.AfterCardsMove, {
  anim_type = "drawcard",
  can_trigger = function(self, event, target, player, data)
    if player:hasSkill(bojianxiong.name) then  -- 移除次数判断
      local ban_players = {player}
      if player.room.current.phase ~= Player.NotActive then
        table.insert(ban_players, player.room.current)
      end
      local x = 0
      for _, move in ipairs(data) do
        if move.to and not table.contains(ban_players, move.to) and move.toArea == Card.PlayerHand then
          x = x + #move.moveInfo
        end
      end
      if x > 0 then
        event:setCostData(self, {choice = x})
        return true
      end
    end
  end,
  on_use = function(self, event, target, player, data)
    player:drawCards(event:getCostData(self).choice, bojianxiong.name)
  end,
})

bojianxiong:addEffect(fk.HpRecover, {
  anim_type = "support",
  can_trigger = function(self, event, target, player, data)
    -- 移除次数判断
    return target ~= player and player:hasSkill(bojianxiong.name) and player:isWounded() and
      player.room.current ~= target
  end,
  on_use = function(self, event, target, player, data)
    player.room:recover{
      who = player,
      num = data.num,
      recoverBy = player,
      skillName = bojianxiong.name,
    }
  end,
})

return bojianxiong